//
//  SpeedCoach_Importer_AppDelegate.h
//  SpeedCoach Importer
//
//  Created by Roelant Ossewaarde on 4/8/11.
//  Copyright SUNY Buffalo 2011 . All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import <LogMessage.h>
#import <MainWindowViewController.h>
#import <SpeedCoachComms.h>
#import <SpeedCoachMemoryBlock.h>
#import <Chunk.h>

@interface SpeedCoach_Importer_AppDelegate : NSObject 
{
    NSWindow *window;
    
    NSPersistentStoreCoordinator *persistentStoreCoordinator;
    NSManagedObjectModel *managedObjectModel;
    NSManagedObjectContext *managedObjectContext;
	NSMutableArray *logMessages;
	MainWindowViewController *mwvc;
	NSData *eprom1Data;
	NSData *eprom2Data;
	IBOutlet NSMenuItem *saveRawEprom1MenuItem;
	IBOutlet NSMenuItem *saveRawEprom2MenuItem;
	IBOutlet NSMenuItem *exportMemoryBlock;
	SpeedCoachMemoryBlock *memoryBlock;
	

}

@property (nonatomic, retain) IBOutlet NSWindow *window;

@property (nonatomic, retain, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator;
@property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel;
@property (nonatomic, retain, readonly) NSManagedObjectContext *managedObjectContext;
@property (nonatomic, retain, readonly) NSMutableArray *logMessages;
@property (nonatomic, retain) MainWindowViewController *mwvc;

- (IBAction)saveAction:sender;
- (IBAction)importFromSpeedCoach:(id)sender;
-(void) log:(NSString *)theMessage severity:(int)theSeverity;
-(void) updateNumBytesRead:(double)numBytes;
-(IBAction) saveEprom:(id) sender;
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)anItem;
-(IBAction) readEprom:(id) sender;
-(IBAction) export:(id) sender;
@end
